package cn.edu.xmu.orderpayment.order.microservice.vo;

import cn.edu.xmu.orderpayment.order.model.bo.OrderItem;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Min;

/**
 * @author Li Yixuan 22920192204232
 * @create: 2021/12/19
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class FreightCalculatingPostVo {
    @Min(1)
    private Long productId;

    @Min(0)
    private Long quantity;

    @Min(1)
    private Long freightId;

    @Min(0)
    private Long weight;


    public FreightCalculatingPostVo(ProductRetVo productRetVo, Long quantity){
        this.productId=productRetVo.getId();
        this.quantity=quantity;
        this.freightId=productRetVo.getFreightId();
        this.weight=productRetVo.getWeight();
    }
}
